# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=tracker-miners
pkgver=2.0.1
pkgrel=1
pkgdesc="Collection of data extractors for Tracker/Nepomuk"
url="https://wiki.gnome.org/Projects/Tracker"
arch=(i686 x86_64)
license=(GPL)
depends=(tracker gst-plugins-base-libs exempi flac libexif libcue libgrss libgsf libgxps
         libiptcdata libosinfo libvorbis poppler-glib taglib totem-plparser giflib)
makedepends=(intltool git python)
groups=(gnome)
_commit=ac258c77b7b79765cb3884daa1766577c5d08307  # tags/2.0.1^0
source=("git+https://git.gnome.org/browse/tracker-miners#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib/$pkgname \
    --enable-unit-tests \
    --enable-functional-tests \
    --enable-libflac \
    --enable-libvorbis \
    --enable-guarantee-metadata
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  # Some tests only work with the schemas installed
  dbus-run-session make -k check || :
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  rm -r "$pkgdir/usr/share/tracker-tests"
}
